///////////////////////////////////////////////////////////////////////////////
//-----------------------------------------------------------------------------
#ifndef	__APPLICATION_H__
#define	__APPLICATION_H__

#include <Config.h>
#include <AbstractManager.h>

//-----------------------------------------------------------------------------

class Application
	:	public AbstractManager<Application>
{
public:
								Application();
	virtual						~Application();

	virtual	void				Update(f32 dt);

	virtual	void				ResolutionChanged();
	virtual void				SetResolution( u16 width, u16 height )
	{
		m_screenWidth = width;
		m_screenHeight = height;
		ResolutionChanged();
	}

	virtual u16				GetResolutionWidth()
	{
		return m_screenWidth;
	}

	virtual u16				GetResolutionHeight()
	{
		return m_screenHeight;
	}

	virtual u32				GetFrameTimeLimit()
	{
		return m_frameTimeLimit;
	}

	virtual void			SetFrameTimeLimit(u32 ftl)
	{
		if( ftl > 1000 ) ftl = 1000;
		m_frameTimeLimit = ftl;
	}

	virtual void			SetRunArguments(int argc, char** argv)
	{
		m_argv.clear();
		for( m_argc = 0; m_argc < argc; m_argc++ )
		{
			m_argv.push_back( argv[m_argc] );
		}
	}

	virtual u16				GetArgCount()
	{
		return m_argc;
	}

	virtual std::string		GetArg(u16 arg)
	{
		if( arg >= 0 && arg < m_argc )
		{
			return m_argv[arg];
		}
		return "";
	}

private:

	u16							m_screenWidth;
	u16							m_screenHeight;

	u32							m_frameTimeLimit;

	u16							m_argc;
	std::vector<std::string>	m_argv;
};

#endif	//	__APPLICATION_H__
//-----------------------------------------------------------------------------
///////////////////////////////////////////////////////////////////////////////
